/**
 * @product: SOD
 * @copyright: FSAI-南征北战信息科技
 * @filename: com.sod.app.mapper.base.BaseDaoImpl.java
 *
 * @link: Http://www.fastsai.com
 * @jdkv: Jdk 1.8
 */
package com.fsai.cms.base.dao;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.stereotype.Repository;

/**
 *
 * @project: sod-web-app
 *
 * @author: JaffeHe
 * @email: JaffeHe@foxmail.com
 * @date: 2020-07-14 10:08
 *
 * @ChangeLog<br/>
 * 				Developer Date Comment <br/>
 */
@SuppressWarnings("rawtypes")
@Repository
public class BaseDaoImpl<T> implements IBaseDao<T> {

	@Resource
	private SqlSessionTemplate sqlSessionTemplate;

	@Override
	public int save(String mapper, Map parameter) {
		return sqlSessionTemplate.insert(mapper, parameter);
	}

	@Override
	public int update(String mapper, Map parameter) {
		return sqlSessionTemplate.update(mapper, parameter);
	}

	@Override
	public int delete(String mapper, Map parameter) {
		return sqlSessionTemplate.delete(mapper, parameter);
	}

	@Override
	public T find(String mapper, Map parameter) {
		return sqlSessionTemplate.selectOne(mapper, parameter);
	}

	@Override
	public List<T> findList(String mapper, Map parameter) {
		return sqlSessionTemplate.selectList(mapper, parameter);
	}

}
